﻿using System.Linq;
using AutoMapper;
using Colorful.Furniture.EnterpriseManagement;
using Colorful.Furniture.ErpOrderManagement;
using Colorful.Furniture.ErpSupplierManagement;
using Colorful.Furniture.Extensions;
using Colorful.Furniture.PermissionManagement;


namespace Colorful.Furniture.ErpCustomerManagement
{
    /// <summary>
    ///  供应商管理映射配置
    /// </summary>
    public class CustomerAutoMapperProfile : Profile
    {
        /// <summary>
        /// 自动映射
        /// </summary>
        public CustomerAutoMapperProfile()
        {
            //****************************输入************************

            //创建/更新成员 -> 数据成员表
            CreateMap<SaveCustomerInputDto, Customer>();

            ////客户账户余额充值
            //CreateMap<SaveRechargeCustomerInputDto, Customer>();

            CreateMap<ManagerSaveInputDto, SysManager>()
                .ForMember(x => x.Birthday, y => y.MapFrom(z => z.Birthday.ToNullableDateTime()))
                .ForMember(x => x.DepartmentId, y => y.MapFrom(z => z.DepartmentIdList.Last()));

            ////客户订单
            //CreateMap<CustomerOrderAppointPagedInputDto, CustomerOrder>();

            //CreateMap<CustomerOrderPagedInputDto, CustomerOrder>();

            CreateMap<BlackListSaveInputDto, BlackList>();

            //****************************输出************************

            //客户列表
            CreateMap<Customer, CustomerPagedOutputDto>();


            ////客户订单
            //CreateMap<CustomerOrder, CustomerOrderPagedOutputDto>();

            ////客户订单
            //CreateMap<CustomerOrder, CustomerOrderOutputDto>();

            ////客户订单回调信息
            //CreateMap<CustomerOrderCallbackLog, CustomerOrderCallbackLogOutputDto>();

            ////客户订单
            //CreateMap<CustomerOrder, CustomerOrderDownOutputDto>();


        }
    }
}
